package org.stvd.entities.guide.examples;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.format.annotation.DateTimeFormat;
import org.stvd.entities.base.BaseEntity;
import org.stvd.entities.common.LongJsonDeserializer;
import org.stvd.entities.common.LongJsonSerializer;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

/**
 * @Title BsExampleInfo
 * @Describtion 示例实体
 * @author houzx
 * @date 2022年6月1日
 */
@Entity
@Table(name = "bs_example_info")
public class BsExampleInfo extends BaseEntity{

    private static final long serialVersionUID = 4341299567259249723L;
    
    /**
     * 主键ID
     */
    @Id
    @Column(name = "id", nullable = false)
    @JsonSerialize(using = LongJsonSerializer.class)
    @JsonDeserialize(using = LongJsonDeserializer.class)
    private Long id = null;
    
    /**
     * 名称
     */
    @Column(name = "name", nullable = false)
    @NotEmpty(message = "名称不能为空")
    @Length(max = 20, message = "用户名称长度超出最大限制")
    private String name = "";
    
    /**
     * 生日
     */
    @Column(name = "birthday")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birthday = null;
    
    /**
     * 性别
     */
    @Column(name = "sex")
    private String sex = "";
    
    /**
     * 爱好
     */
    @Column(name = "hobby")
    private String hobby = "";
    
    /**
     * 个性签名
     */
    @Column(name = "signature")
    private String signature = "";

    /**
     *录入人
     */
    @Column(name = "create_user", nullable = false)
    private String createUser = "";

    /**
     *录入时间
     */
    @Column(name = "create_time", nullable = false)
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createTime = null;

    /**
     * 修改时间
     */
    @Column(name = "modify_time")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date modifyTime = null;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getHobby() {
        return hobby;
    }

    public void setHobby(String hobby) {
        this.hobby = hobby;
    }

    public String getSignature() {
        return signature;
    }

    public void setSignature(String signature) {
        this.signature = signature;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }

    public static long getSerialversionuid() {
        return serialVersionUID;
    }
    
    
}
